<div id="<*$controller*>">
<div class="span5">
<form action="/<*$controller*>/opedit" method="post" onsubmit="return checkLoginForm();" >
  <div class="span3">
        <label class="control-label pull-left" >属主&nbsp;&nbsp;&nbsp;(0表示本身为属主)</label><br />
          <select name="fid" id="fid" class="input-block-level" style="z-index:10">
              <option value="0">0</option>
            <*foreach from=$fathermenu item=item key=key*>
              <option value="<*$item.menuid*>" <*if $res.fathermenu eq $item.menuid*>selected<*/if*>><*$item.menu*></option>
            <*/foreach*>  
          </select>
          
        <label class="control-label pull-left" >名称</label><input type="text" class="input-block-level" autocomplete="off" value="<*$res.menu*>" id="name" name="name" >
        <label class="control-label pull-left" >链接</label><input type="text" class="input-block-level" autocomplete="off" placeholder="controller_action"  id="href" name="href" value="<*$res.menu_en*>" >
        <label class="control-label" ><input type="checkbox" id="istopbar" <*if $res.istopbar*>checked="checked"<*/if*> name="istopbar" >是否首页</label>
        <label class="control-label" ><input type="checkbox" id="ishidden" <*if $res.ishidden eq 0*>checked="checked"<*/if*> name="ishidden" >是否可用</label>
        <button type="submit" class="btn btn-primary">保存修改</button>
        <button type="button" class="btn" onclick="window.location='/<*$controller*>/index'" >返回</button>
  <input type="hidden" value="<*$res.menuid*>" name="menuid" id="menuid"/>
  </div>
</form>
</div>
</div>
<script type="text/javascript" >
function checkLoginForm(){
	var name=document.getElementById('name').value;
	var href=document.getElementById('href').value;
	if(name=='' || name==null){
		alert('需要输入名称');
		document.getElementById("name").focus();
		return false;
	}
	if(href=='' || href==null){
		alert('需要输入链接');
		document.getElementById("href").focus();
		return false;
	}
	
	return true;
}
</script>
